using System;
using System.Collections.Generic;
using System.Text;

namespace SkyBurner
{
    public class SkyBurnerGlobal
    {
        private const int MAX_SHIELD_VALUE = 100;
        private const int MAX_ENERGY_VALUE = 100;
        private const int MAX_ROCKET_COUNT = 3;

        private static int m_nScore;
        private static int m_nHiScore;
        private static int m_nEnergyValue;
        private static int m_nShieldValue;
        private static int m_nRocketCount;

        public static int Score
        {
            get { return m_nScore; }
        }

        public static int HiScore
        {
            get { return m_nHiScore; }
            set { m_nHiScore = value; }
        }

        public static int EnergyValue
        {
            get { return m_nEnergyValue; }
        }

        public static int ShieldValue
        {
            get { return m_nShieldValue; }
        }

        public static int RocketCount
        {
            get { return m_nRocketCount; }
        }

        public static void Reset()
        {            
            m_nScore = 0;
            m_nHiScore = 0;
            m_nEnergyValue = MAX_ENERGY_VALUE;
            m_nShieldValue = MAX_SHIELD_VALUE;
            m_nRocketCount = MAX_ROCKET_COUNT;
        }
        
        public static void DecrementEnergy(int pAmount)
        {
            m_nEnergyValue -= pAmount;
            m_nEnergyValue = Math.Max(m_nEnergyValue, 0);
        }

        public static void IncrementEnergy(int pAmount)
        {
            m_nEnergyValue += pAmount;
            m_nEnergyValue = Math.Min(m_nEnergyValue, MAX_ENERGY_VALUE);
        }

        public static void DecrementShield(int pAmount)
        {
            m_nShieldValue -= pAmount;
            m_nShieldValue = Math.Max(m_nShieldValue, 0);
        }

        public static void IncrementShield(int pAmount)
        {
            m_nShieldValue += pAmount;
            m_nShieldValue = Math.Min(m_nShieldValue, MAX_SHIELD_VALUE);
        }

        public static void AddScore(int pScoreAmount)
        {
            m_nScore += pScoreAmount;
        }

        public static void DecrementRocket()
        {
            m_nRocketCount--;
        }

        public static void IncrementRocket()
        {
            m_nRocketCount++;
            m_nRocketCount = Math.Min(m_nRocketCount, MAX_ROCKET_COUNT);
        }
    }
}
